<?php
require_once('PHPUnit/Framework.php');
require_once('TVB/mytvplus/portal_service/common/bootstrap.php');
require_once('TVB/mytvplus/portal_service/common/util/PortalReceive.class.php');

class PortalReceiveTest extends PHPUnit_Framework_Testcase
{
    public $portal_receive;

    public function setUp()
    {
        $this->portal_receive = new PortalReceive;
    }

    public function testRemoveOldFolderByProgramme()
    {
        $objects[0]->id = 100590;
        $objects[0]->programme_id = 100012;
        $objects[0]->episode_id = 0;

        //$this->portal_receive->removeOldFolder($objects);
    }

    public function testRemoveOldFolderByEpisode()
    {
        $objects[0]->id = 100590;
        $objects[0]->programme_id = 100179;
        $objects[0]->episode_id = 103139;

        //$this->portal_receive->removeOldFolder($objects);
    }

    public function testRemoveOldCast()
    {
        $objects[0]->id = 100321;
        $objects[0]->programme_id = 100179;

        //$this->portal_receive->removeOldCast($objects);
    }

    public function testRemoveOldChapter()
    {
        $objects[0]->id = 106532;
        $objects[0]->programme_id = 100148;

        //$this->portal_receive->removeOldChapter($objects);
    }

    public function testRemoveOldVideo()
    {
        $objects[0]->id = 102401;
        $objects[0]->programme_id = 100127;

        //$this->portal_receive->removeOldVideo($objects);
    }

    public function testRemoveOldInfo()
    {
        $objects[0]->id = 3;
        $objects[0]->info_type_id = 8;
        $objects[0]->programme_id = 382;
        $objects[0]->episode_id = 100034;

        $objects[1]->id = 4;
        $objects[1]->info_type_id = 8;
        $objects[1]->programme_id = 382;
        $objects[1]->episode_id = 100034;

        //$this->portal_receive->removeOldInfo($objects);
    }

    public function testRemoveOldFolderVideo()
    {
        $objects[0]->folder_id = 105800;
        $objects[0]->video_id = 102500;
        $objects[0]->programme_id = 100179;

        $objects[1]->folder_id = 105801;
        $objects[1]->video_id = 102526;
        $objects[1]->programme_id = 100179;

        //$this->portal_receive->removeOldFolderVideo($objects);
    }

    public function testRemoveOldFolderImage()
    {
        $objects[0]->folder_id = 103684;
        $objects[0]->image_id = 103327;
        $objects[0]->programme_id = 100127;
        $objects[0]->episode_id = 0;

        $objects[1]->folder_id = 103685;
        $objects[1]->image_id = 103328;
        $objects[1]->programme_id = 100127;
        $objects[1]->episode_id = 0;

        $this->portal_receive->removeOldFolderImage($objects);
    }

    public function testRemoveOldImage()
    {
        $objects[0]->id = 103328;
        $objects[0]->programme_id = 100127;
        $objects[0]->episode_id = 100123;

        $this->portal_receive->removeOldImage($objects);
    }

}
